package down.sallai.ml.util;

import down.sallai.ml.services.FileManger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @description: $
 * @author: sallai
 * @time: 2022年2月3日 0003 上午 10:03:55 秒
 */
@Component
@Configuration
@EnableScheduling
public class StaticTimerTask {


    @Autowired
    private FileManger fileManger;
    @Value("mydown.fileLocal")
    private String filePath;

    @Scheduled(cron = "0 0 3 * * ?")
    private void clearAllFile() {
        System.out.println("执行定时器方法");
        fileManger.clearAllFile(filePath);
    }
}
